import {http} from "@/utils/http";
import {baseUrlApi} from "@/utils/request";

type Result = {
    success: boolean;
    data?: {
        /** 列表数据 */
        records: Array<any>;
        /** 总条目数 */
        totalNum?: number;
        /** 每页显示条目个数 */
        pageSize?: number;
        /** 当前页数 */
        pageNo?: number;
    };
};

/** 查询列表 */
export const listKctz = (data?: object) => {
    return http.request<Result>(
        "post",
        baseUrlApi("/kctz/listKctzByPage"),
        {data}
    );
};

/** 添加*/
export const addKctz = (data?: object) => {
    return http.request<Result>("post", baseUrlApi("/kctz"), {data});
};


/** 修改 */
export const updateKctz = (data?: object) => {
    return http.request<Result>("put", baseUrlApi("/kctz"), {data});
};


/** 删除 */
export const deleteKctz = (id?: string) => {
    return http.request<Result>("delete", baseUrlApi("/kctz"), {params: {idList: id}});
};
